import {defineConfig, presetIcons, presetUno} from 'unocss'
import {FileSystemIconLoader} from 'unplugin-icons/loaders'

export default defineConfig({
    presets: [
        presetUno(),
        presetIcons({
            customizations: {
                customize(props) {
                    props.width = '2em'
                    props.height = '2em'
                    return props
                }
            },
            collections: {
                'svg': FileSystemIconLoader(
                    './src/assets/svg',
                    svg => svg.replace(/^<svg /, '<svg fill="currentColor" ',)
                        .replace(/(<svg.*?width=)"(.*?)"/, '$1"1.2em"')
                        .replace(/(<svg.*?height=)"(.*?)"/, '$1"1.2em"'),
                )
            },

        })
    ]
})
